import request from "@/utils/request";

const EmployeeAPI = {
  /** 新增员工*/
  add(data: any) {
    return request({
      url: `/admin/employee/add`,
      method: "post",
      data,
      headers: {
        "Content-Type": "application/json",
      },
    });
  },
  /** 员工列表*/
  list(data: any) {
    return request({
      url: "/admin/employee/page",
      method: "post",
      data,
      headers: {
        "Content-Type": "application/json",
      },
    });
  },
  /** 员工禁用账户*/
  enableDisable(data: any) {
    return request({
      url: "/admin/employee/status",
      method: "post",
      data,
      headers: {
        "Content-Type": "application/json",
      },
    });
  },
  /** 回显员工账户*/
  detail(id: any) {
    return request({
      url: `/admin/employee/${id}`,
      method: "get",
    });
  },
  /** 修改员工账户*/
  change(data: any) {
    return request({
      url: "/admin/employee",
      method: "PUT",
      data,
      headers: {
        "Content-Type": "application/json",
      },
    });
  },
  delEmployee(id: any) {
    return request({
      url: `/admin/employee/delete/${id}`,
      method: "DELETE",
    });
  },
};

export default EmployeeAPI;
